//UserMGR.h
//////////////////////////////////////////////////////////////////////////////////
//																				//
// UserMGR.h																	//
// Revision : Taek han, Go(FreeMan)												//
// Revision Date : 2007-01-24													//
// Perpose : Management of User Data											//
//																				//
//////////////////////////////////////////////////////////////////////////////////
#ifndef _USERMGR_H
#define _USERMGR_H

#include "UserInformation.h"
#include "LinkedList.h"

class UserMGR{
public:

	//////////////////////////////
	// Constructor & Destructor	//
	//////////////////////////////
	
	//Constructor
	UserMGR();

	//Destructor
	virtual ~UserMGR();

	//Copy Constructor
	UserMGR(const UserMGR& source);


	
	//////////////////////////////
	// Operators				//
	//////////////////////////////
	
	// = Operator
	UserMGR& operator = (const UserMGR& source);

	// [] Operator
	UserInformation& operator [] (int index);


	//////////////////////////////
	// Member Functinos			//
	//////////////////////////////
	
	//TakeIn
	UserInformation* Record( UserInformation userInformation );
	
	//Find By MacAddress
	UserInformation* Find( string macAddress );
	
	//Find By UserInformation
	void Find(UserInformation* user, unsigned int* count, Tag*** searchedTaglist);
	
	//Get Count
	int GetCount() const;

	//Get UserInformation
	UserInformation* GetUserInformation();

	//Load DB - Load the Database
	void LoadDB();

	//Insert BookMark at Database
	void InsertBookMark( string title, string emailAddress );

	friend int CompareBymacAddress(void* one, void* other);

private:
	int count;
	LinkedList<UserInformation> users;
	

};

inline int UserMGR::GetCount() const
{
	return this->count;
}

inline UserInformation* UserMGR::GetUserInformation()
{
	return this->users.First()->GetObjectLink();
}


#endif
